// Created from GenerationTemplate
// For Decisions HL7 Engine
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Reflection;
using DecisionsFramework.Design.Properties;
using Decisions.HL7.Generated.AbstractMessage;
using Decisions.HL7.DataTypes;
using ST = System.String;
using SI = System.String;
using TX = System.String;
using FT = System.String;
using IS = System.String;
using ID = System.String;
using SNM = System.String;

namespace Decisions.HL7.Message
{
    [DataContract]
	public class PD1 : AbstractSegment
    {

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("1 Living Dependency",1)]
  	    [HL7Field(HL7Version.v23, 1, HL7Repeat.True, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.True, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.True, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.True, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.True, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.True, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.True, HL7Required.True,"CWE")]
		[LivingDependency]
	    public CWE[] LivingDependency {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("2 Living Arrangement",2)]
  	    [HL7Field(HL7Version.v23, 2, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v231, 2, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v24, 2, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 2, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 2, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 2, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 2, HL7Repeat.False, HL7Required.True,"CWE")]
		[LivingArrangement]
	    public CWE LivingArrangement {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("3 Patient Primary Facility",3)]
  	    [HL7Field(HL7Version.v23, 3, HL7Repeat.True, HL7Required.True,"XON")]
  	    [HL7Field(HL7Version.v231, 3, HL7Repeat.True, HL7Required.True,"XON")]
  	    [HL7Field(HL7Version.v24, 3, HL7Repeat.True, HL7Required.True,"XON")]
  	    [HL7Field(HL7Version.v25, 3, HL7Repeat.True, HL7Required.True,"XON")]
  	    [HL7Field(HL7Version.v251, 3, HL7Repeat.True, HL7Required.True,"XON")]
  	    [HL7Field(HL7Version.v26, 3, HL7Repeat.True, HL7Required.True,"XON")]
  	    [HL7Field(HL7Version.v27, 3, HL7Repeat.True, HL7Required.True,"XON")]
		[OrganizationalNameType]
	    public XON[] PatientPrimaryFacility {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("4 Patient Primary Care Provider Name & ID No.",4)]
  	    [HL7Field(HL7Version.v23, 4, HL7Repeat.True, HL7Required.True,"XCN")]
  	    [HL7Field(HL7Version.v231, 4, HL7Repeat.True, HL7Required.True,"XCN")]
  	    [HL7Field(HL7Version.v24, 4, HL7Repeat.True, HL7Required.True,"XCN")]
  	    [HL7Field(HL7Version.v25, 4, HL7Repeat.True, HL7Required.True,"XCN")]
  	    [HL7Field(HL7Version.v251, 4, HL7Repeat.True, HL7Required.True,"XCN")]
  	    [HL7Field(HL7Version.v26, 4, HL7Repeat.True, HL7Required.True,"XCN")]
	    public XCN[] PatientPrimaryCareProviderNameIDNo {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("5 Student Indicator",5)]
  	    [HL7Field(HL7Version.v23, 5, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v231, 5, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v24, 5, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 5, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 5, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 5, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 5, HL7Repeat.False, HL7Required.True,"CWE")]
		[StudentStatus]
	    public CWE StudentIndicator {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("6 Handicap",6)]
  	    [HL7Field(HL7Version.v23, 6, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v231, 6, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v24, 6, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 6, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 6, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 6, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 6, HL7Repeat.False, HL7Required.True,"CWE")]
		[Handicap]
	    public CWE Handicap {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("7 Living Will Code",7)]
  	    [HL7Field(HL7Version.v23, 7, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v231, 7, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v24, 7, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 7, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 7, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 7, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 7, HL7Repeat.False, HL7Required.True,"CWE")]
		[LivingWillCode]
	    public CWE LivingWillCode {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("8 Organ Donor Code",8)]
  	    [HL7Field(HL7Version.v23, 8, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v231, 8, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v24, 8, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 8, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 8, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 8, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 8, HL7Repeat.False, HL7Required.True,"CWE")]
		[OrganDonorCode]
	    public CWE OrganDonorCode {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("9 Separate Bill",9)]
  	    [HL7Field(HL7Version.v23, 9, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v231, 9, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v24, 9, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v25, 9, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v251, 9, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v26, 9, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v27, 9, HL7Repeat.False, HL7Required.True,"ID")]
		[YesnoIndicator]
	    public ID SeparateBill {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("10 Duplicate Patient",10)]
  	    [HL7Field(HL7Version.v23, 10, HL7Repeat.True, HL7Required.True,"CX")]
  	    [HL7Field(HL7Version.v231, 10, HL7Repeat.True, HL7Required.True,"CX")]
  	    [HL7Field(HL7Version.v24, 10, HL7Repeat.True, HL7Required.True,"CX")]
  	    [HL7Field(HL7Version.v25, 10, HL7Repeat.True, HL7Required.True,"CX")]
  	    [HL7Field(HL7Version.v251, 10, HL7Repeat.True, HL7Required.True,"CX")]
  	    [HL7Field(HL7Version.v26, 10, HL7Repeat.True, HL7Required.True,"CX")]
  	    [HL7Field(HL7Version.v27, 10, HL7Repeat.True, HL7Required.True,"CX")]
	    public CX[] DuplicatePatient {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("11 Publicity Indicator",11)]
  	    [HL7Field(HL7Version.v23, 11, HL7Repeat.False, HL7Required.True,"CE_0215")]
  	    [HL7Field(HL7Version.v231, 11, HL7Repeat.False, HL7Required.True,"CE_0215")]
  	    [HL7Field(HL7Version.v24, 11, HL7Repeat.False, HL7Required.True,"CE_0215")]
  	    [HL7Field(HL7Version.v25, 11, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v251, 11, HL7Repeat.False, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v26, 11, HL7Repeat.False, HL7Required.True,"CWE")]
  	    [HL7Field(HL7Version.v27, 11, HL7Repeat.False, HL7Required.True,"CWE")]
		[PublicityCode]
	    public CWE PublicityIndicator {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("12 Protection Indicator",12)]
  	    [HL7Field(HL7Version.v23, 12, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v231, 12, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v24, 12, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v25, 12, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v251, 12, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v26, 12, HL7Repeat.False, HL7Required.True,"ID")]
  	    [HL7Field(HL7Version.v27, 12, HL7Repeat.False, HL7Required.True,"ID")]
		[YesnoIndicator]
	    public ID ProtectionIndicator {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("13 Protection Indicator Effective Date",13)]
  	    [HL7Field(HL7Version.v24, 13, HL7Repeat.False, HL7Required.True,"DT")]
  	    [HL7Field(HL7Version.v25, 13, HL7Repeat.False, HL7Required.True,"DT")]
  	    [HL7Field(HL7Version.v251, 13, HL7Repeat.False, HL7Required.True,"DT")]
  	    [HL7Field(HL7Version.v26, 13, HL7Repeat.False, HL7Required.True,"DT")]
  	    [HL7Field(HL7Version.v27, 13, HL7Repeat.False, HL7Required.True,"DT")]
	    public DT ProtectionIndicatorEffectiveDate {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("14 Place of Worship",14)]
  	    [HL7Field(HL7Version.v24, 14, HL7Repeat.True, HL7Required.True,"XON")]
  	    [HL7Field(HL7Version.v25, 14, HL7Repeat.True, HL7Required.True,"XON")]
  	    [HL7Field(HL7Version.v251, 14, HL7Repeat.True, HL7Required.True,"XON")]
  	    [HL7Field(HL7Version.v26, 14, HL7Repeat.True, HL7Required.True,"XON")]
  	    [HL7Field(HL7Version.v27, 14, HL7Repeat.True, HL7Required.True,"XON")]
	    public XON[] PlaceofWorship {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("15 Advance Directive Code",15)]
  	    [HL7Field(HL7Version.v24, 15, HL7Repeat.True, HL7Required.True,"CE_0435")]
  	    [HL7Field(HL7Version.v25, 15, HL7Repeat.True, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v251, 15, HL7Repeat.True, HL7Required.True,"CE")]
  	    [HL7Field(HL7Version.v26, 15, HL7Repeat.True, HL7Required.True,"CWE")]
  	    [HL7Field(HL7Version.v27, 15, HL7Repeat.True, HL7Required.True,"CWE")]
		[AdvanceDirectiveCode]
	    public CWE[] AdvanceDirectiveCode {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("16 Immunization Registry Status",16)]
  	    [HL7Field(HL7Version.v24, 16, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 16, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 16, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 16, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 16, HL7Repeat.False, HL7Required.True,"CWE")]
		[ImmunizationRegistryStatus]
	    public CWE ImmunizationRegistryStatus {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("17 Immunization Registry Status Effective Date",17)]
  	    [HL7Field(HL7Version.v24, 17, HL7Repeat.False, HL7Required.True,"DT")]
  	    [HL7Field(HL7Version.v25, 17, HL7Repeat.False, HL7Required.True,"DT")]
  	    [HL7Field(HL7Version.v251, 17, HL7Repeat.False, HL7Required.True,"DT")]
  	    [HL7Field(HL7Version.v26, 17, HL7Repeat.False, HL7Required.True,"DT")]
  	    [HL7Field(HL7Version.v27, 17, HL7Repeat.False, HL7Required.True,"DT")]
	    public DT ImmunizationRegistryStatusEffectiveDate {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("18 Publicity Code Effective Date",18)]
  	    [HL7Field(HL7Version.v24, 18, HL7Repeat.False, HL7Required.True,"DT")]
  	    [HL7Field(HL7Version.v25, 18, HL7Repeat.False, HL7Required.True,"DT")]
  	    [HL7Field(HL7Version.v251, 18, HL7Repeat.False, HL7Required.True,"DT")]
  	    [HL7Field(HL7Version.v26, 18, HL7Repeat.False, HL7Required.True,"DT")]
  	    [HL7Field(HL7Version.v27, 18, HL7Repeat.False, HL7Required.True,"DT")]
	    public DT PublicityCodeEffectiveDate {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("19 Military Branch",19)]
  	    [HL7Field(HL7Version.v24, 19, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 19, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 19, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 19, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 19, HL7Repeat.False, HL7Required.True,"CWE")]
		[MilitaryService]
	    public CWE MilitaryBranch {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("20 Military Rank/Grade",20)]
  	    [HL7Field(HL7Version.v24, 20, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 20, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 20, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 20, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 20, HL7Repeat.False, HL7Required.True,"CWE")]
		[MilitaryRankGrade]
	    public CWE MilitaryRankGrade {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("21 Military Status",21)]
  	    [HL7Field(HL7Version.v24, 21, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 21, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 21, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 21, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 21, HL7Repeat.False, HL7Required.True,"CWE")]
		[MilitaryStatus]
	    public CWE MilitaryStatus {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("22 Advance Directive Last Verified Date",22)]
  	    [HL7Field(HL7Version.v26, 22, HL7Repeat.False, HL7Required.True,"DT")]
  	    [HL7Field(HL7Version.v27, 22, HL7Repeat.False, HL7Required.True,"DT")]
	    public DT AdvanceDirectiveLastVerifiedDate {get;set;}


	    [DataMember]
        [PropertyClassification("AdditionalValue1", 23)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue1 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue2", 24)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue2 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue3", 25)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue3 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue4", 26)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue4 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue5", 27)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue5 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue6", 28)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue6 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue7", 29)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue7 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue8", 30)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue8 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue9", 31)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue9 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue10", 32)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue10 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue11", 33)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue11 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue12", 34)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue12 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue13", 35)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue13 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue14", 36)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue14 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue15", 37)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue15 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue16", 38)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue16 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue17", 39)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue17 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue18", 40)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue18 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue19", 41)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue19 { get; set; }

		    [DataMember]
        [PropertyClassification("AdditionalValue20", 42)]
		[HL7Field(HL7Version.v23, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.False)]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.False)]
		public string AdditionalValue20 { get; set; }

	

		internal override void ConsumeTextSegment(string segmentTextData, HL7ParserOptions options)
		{
			string[] segmentTextParts = segmentTextData.Split(new char[] { options.FieldSep }, StringSplitOptions.None);
	    	LivingDependency = (CWE[])ParseTextAtPositionIntoDataArray<CWE>(segmentTextParts, 1, options, "PD1.1");
			LivingArrangement = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 2, options, typeof(CWE), "PD1.2");
	    	PatientPrimaryFacility = (XON[])ParseTextAtPositionIntoDataArray<XON>(segmentTextParts, 3, options, "PD1.3");
	    	PatientPrimaryCareProviderNameIDNo = (XCN[])ParseTextAtPositionIntoDataArray<XCN>(segmentTextParts, 4, options, "PD1.4");
			StudentIndicator = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 5, options, typeof(CWE), "PD1.5");
			Handicap = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 6, options, typeof(CWE), "PD1.6");
			LivingWillCode = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 7, options, typeof(CWE), "PD1.7");
			OrganDonorCode = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 8, options, typeof(CWE), "PD1.8");
			SeparateBill = (ID)ParseTextAtPositionIntoData(segmentTextParts, 9, options, typeof(ID), "PD1.9");
	    	DuplicatePatient = (CX[])ParseTextAtPositionIntoDataArray<CX>(segmentTextParts, 10, options, "PD1.10");
			PublicityIndicator = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 11, options, typeof(CWE), "PD1.11");
			ProtectionIndicator = (ID)ParseTextAtPositionIntoData(segmentTextParts, 12, options, typeof(ID), "PD1.12");
			ProtectionIndicatorEffectiveDate = (DT)ParseTextAtPositionIntoData(segmentTextParts, 13, options, typeof(DT), "PD1.13");
	    	PlaceofWorship = (XON[])ParseTextAtPositionIntoDataArray<XON>(segmentTextParts, 14, options, "PD1.14");
	    	AdvanceDirectiveCode = (CWE[])ParseTextAtPositionIntoDataArray<CWE>(segmentTextParts, 15, options, "PD1.15");
			ImmunizationRegistryStatus = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 16, options, typeof(CWE), "PD1.16");
			ImmunizationRegistryStatusEffectiveDate = (DT)ParseTextAtPositionIntoData(segmentTextParts, 17, options, typeof(DT), "PD1.17");
			PublicityCodeEffectiveDate = (DT)ParseTextAtPositionIntoData(segmentTextParts, 18, options, typeof(DT), "PD1.18");
			MilitaryBranch = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 19, options, typeof(CWE), "PD1.19");
			MilitaryRankGrade = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 20, options, typeof(CWE), "PD1.20");
			MilitaryStatus = (CWE)ParseTextAtPositionIntoData(segmentTextParts, 21, options, typeof(CWE), "PD1.21");
			AdvanceDirectiveLastVerifiedDate = (DT)ParseTextAtPositionIntoData(segmentTextParts, 22, options, typeof(DT), "PD1.22");
		}

		public string GetER7(HL7ParserOptions options) {
			List<string> segmentParts = new List<string>();
			segmentParts.Add("PD1");
		    segmentParts.Add(GetER7TextForSegmentArrayPart(LivingDependency, options));
			segmentParts.Add(GetER7TextForSegmentPart(LivingArrangement, options));
		    segmentParts.Add(GetER7TextForSegmentArrayPart(PatientPrimaryFacility, options));
		    segmentParts.Add(GetER7TextForSegmentArrayPart(PatientPrimaryCareProviderNameIDNo, options));
			segmentParts.Add(GetER7TextForSegmentPart(StudentIndicator, options));
			segmentParts.Add(GetER7TextForSegmentPart(Handicap, options));
			segmentParts.Add(GetER7TextForSegmentPart(LivingWillCode, options));
			segmentParts.Add(GetER7TextForSegmentPart(OrganDonorCode, options));
		    segmentParts.Add(SeparateBill);
		    segmentParts.Add(GetER7TextForSegmentArrayPart(DuplicatePatient, options));
			segmentParts.Add(GetER7TextForSegmentPart(PublicityIndicator, options));
		    segmentParts.Add(ProtectionIndicator);
			segmentParts.Add(GetER7TextForSegmentPart(ProtectionIndicatorEffectiveDate, options));
		    segmentParts.Add(GetER7TextForSegmentArrayPart(PlaceofWorship, options));
		    segmentParts.Add(GetER7TextForSegmentArrayPart(AdvanceDirectiveCode, options));
			segmentParts.Add(GetER7TextForSegmentPart(ImmunizationRegistryStatus, options));
			segmentParts.Add(GetER7TextForSegmentPart(ImmunizationRegistryStatusEffectiveDate, options));
			segmentParts.Add(GetER7TextForSegmentPart(PublicityCodeEffectiveDate, options));
			segmentParts.Add(GetER7TextForSegmentPart(MilitaryBranch, options));
			segmentParts.Add(GetER7TextForSegmentPart(MilitaryRankGrade, options));
			segmentParts.Add(GetER7TextForSegmentPart(MilitaryStatus, options));
			segmentParts.Add(GetER7TextForSegmentPart(AdvanceDirectiveLastVerifiedDate, options));
			return string.Join("" + options.FieldSep, segmentParts.ToArray());
		}

    }
}

